<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8" />
    <title>break和continue语句</title>
    <script>
        /*
            break跳出循环
            continue跳过本次循环，执行下一次循环
        */

        // for (var i = 0; i < 5; i++) {
        //     console.log(i);
        //     if (i == 2) {
        //         break;
        //     }
        // }

        for (var i = 0; i < 5; i++) {
            if (i == 2) {
                continue;
            }
            console.log(i);
        }
    </script>
</head>

<body>
</body>